package cn.xiaomubiao.oschine.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

import cn.xiaomubiao.oschine.R;
import cn.xiaomubiao.oschine.util.UIUtils;

/**
 * 综合模块的viewpager适配器
 *
 * @author 余伟舟
 *
 */

public class NewsAdapter  extends FragmentPagerAdapter{


    public  String[] contentTitles;
    List<Fragment> datas ;


    public NewsAdapter(FragmentManager fm , List<Fragment> data) {
        super(fm);
        this.datas=data;
        contentTitles= UIUtils.getStrings(R.array.content_title);
    }

    @Override
    public Fragment getItem(int position) {

        return  datas.get(position);
    }

    @Override
    public int getCount() {
        return contentTitles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return contentTitles[position];
    }
}
